/*****************************************************************************************
This file is a part of Arise library.

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

Arise Engine		PhysicObject.h

					E-mail:	arise_engine@mail.ru

					Origin by DK Engine 0.019:
					dev (avon.dn.ua@gmail.com), Agressor (agress0r@mail.ru)

created:			19.02.2006
last changes:		11.09.2007
*****************************************************************************************/
#pragma once

#include "PhysicShapes.h"
#include "NxPhysics.h"
#include "PhysicMesh.h"


#define PHYSIC_VOLUME_UNDEFINED				(__int16)0x1000
#define PHYSIC_VOLUME_BOX					(__int16)0x1001
#define PHYSIC_VOLUME_SPHERE				(__int16)0x1002
#define PHYSIC_VOLUME_CAPSULE				(__int16)0x1003
#define PHYSIC_VOLUME_TRIANGLE_MESH			(__int16)0x1004
#define PHYSIC_VOLUME_CONVEX_MESH			(__int16)0x1005

#define PHYSIC_VOLUME_OBJECTIVE_DEFAULT		(__int16)0x2000
#define PHYSIC_VOLUME_OBJECTIVE_SELECTIVE	(__int16)0x2001
#define PHYSIC_VOLUME_OBJECTIVE_TRIGGER		(__int16)0x2002


class PhysicObject: public BaseObject
{
private:

public:
	PhysicObject();
	virtual ~PhysicObject();
	
	__int16			type;
	__int16			objective;
	__int16	collision_group;
	D3DXMATRIXA16	transformation;
	SceneObject*	scene_object;
	PhysicShape*	shape;
	bool			is_dynamic;
	bool			is_sleeping;
	
	std::vector<LPD3DXMESH>		d3dx_meshes;
	std::vector<PhysicMesh*>	physic_meshes;

	void Init();
	void Update();
	void Render();
	void ApplyChildTransformation(const D3DXMATRIXA16 &transformation);
	void Release();
};

